home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
RDBLKSPI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-27
|
1KB
|
40 lines
/* rdblkspi.c 4.2 */
/*F****************************************************************************
FUNCTION NAME: rdblkspi
ACTION: Reads count characters from the SPI serial hardware to an
array of short.
PARAMETERS:
array: pointer to an array of bytes to be read from SPI
serial port.
count: number of bytes to read from the SPI port.
RETURNS: (void)
******************************************************************************/
#include <hc11/directives.h>
SMALL
void rdblkspi(array, count)
unsigned short *array; /* pointer to data to be read */
int count; /* number of bytes to be read */
{
/****************************************************************/
/* Note that "while ((count--) > 0)" is equivalent to */
/* "while ((--count) >= 0)" but the pre-decrement version */
/* is more efficient than the post-decrement version. */
/****************************************************************/
while ((--count) >= 0)
*(array++) = rdbytspi();
} /* end of rdblkspi */